import { UtilsModule_blxf } from "../Module/UtilsModule";


/** 基础商品数据 */
export default class BaseShopData_blxf {

    public constructor ( data: object ) {
        this.shopId        = Number(data['ShopId']);
        this.shopName      = data['ShopName'];
        this.shopAtlasName = data['AtlasName'];
        this.shopImgName   = data['ImgName'];

        this.isExtraIcon   = data['isExtraIcon'];
        this.isShowSpine   = data['isShowSpine'];

        this.shopNum   = data['shopNum'];
        this.shopIndex = data['shopIndex'];
    }

    
    /** 商品id */
    shopId        : number = -1;
    /** 商品名 */
    shopName      : string = '商品名';
    /** 图集名 */
    shopAtlasName : string = '';
    /** 图片名 */
    shopImgName   : string = '';

    /** 商品位于摊位位置 */
    shopIndex     : number = -1;
    /** 商品数量 */
    shopNum       : number = 0;


    /** 商品排序值 */
    sortNum  : number = -1;

    /** 是否标记移除 */
    isMarkRemove: boolean = false;

    /** 是否额外图标 */
    isExtraIcon: boolean = false;

    /** 是否显示动画 */
    isShowSpine: boolean = false;

    /** 获取商品id */
    getShopId_blxf () {
        return this.shopId;
    }

    /** 检测商品id */
    onCheckShopId_blxf ( checkShopId: number ) {
        if ( !checkShopId ) {
            return UtilsModule_blxf.instance.Log_blxf(`onCheckShopId_blxf 参数错误, 缺少checkShopId`, 2);
        }

        return checkShopId == this.shopId;
    }

    /** 设置商品排序值 */
    setShopSortNum_blxf ( sortNum: number ) {
        this.sortNum = sortNum;
    }

    /** 获取商品排序值 */
    getShopSortNum_blxf () {
        return this.sortNum;
    }

    /** 设置是否标记移除 */
    setIsMarkRemove_blxf ( isMarkRemove: boolean ) {
        this.isMarkRemove = isMarkRemove;
    }

    /** 获取是否标记移除 */
    getIsMarkRemove_blxf () {
        return this.isMarkRemove;
    }

    /** 获取是否有额外图标 */
    getIsExtraIcon_blxf () {
        return this.isExtraIcon;
    }

    getIsShowSpine_blxf () {
        return this.isShowSpine;
    }

    setIsShowSpine_blxf ( isShow: boolean = false ) {
        this.isShowSpine = isShow;
    }
}
